﻿using MediatR;
using S.Services.SheepMale.Domain.PurchaseSales;
using S.Services.SheepMale.Infrastructure;
using S.Services.SheepMale.Read.Api.Application.ReadCommand.ReadSheepMaleCommand;


namespace S.Services.SheepMale.Read.Api.Application.ReadCommandHandler.ReadSheepMaleCommandHandler
{
    public class GetMomCommandHandler : IRequestHandler<GetMomCommand, SheepMaleInfo>
    {
        private readonly IRepository<SheepMaleInfo> repository;

        public GetMomCommandHandler(IRepository<SheepMaleInfo> repository)
        {
            this.repository = repository;
        }

        public async Task<SheepMaleInfo> Handle(GetMomCommand request, CancellationToken cancellationToken)
        {
            return await repository.GetAsync(request.maleId);
        }
    }
}
